﻿using System;

namespace WebManagement
{
	public class UserAuthentificatedPage : System.Web.UI.Page
	{
		private string urlResource;
		private string keySession;

		public UserAuthentificatedPage(string url, string key)
		{
			urlResource = url;
			keySession = key;
		}

		protected void Page_Init(object sender, EventArgs e)
		{
			if (Session[keySession] == null || !(bool)Session[keySession])
				Server.Transfer(urlResource, true);
		}
	}
}